package com.keson.guard;

import android.Manifest;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;

import androidx.core.app.ActivityCompat;


public class MainActivity extends Activity {
    public static Activity main;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getPermission();
        main = MainActivity.this;
    }

    @Override
    protected void onResume() {
        finish();
        super.onResume();
    }

    public void getPermission(){
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.INTERNET
                    ,Manifest.permission.ACCESS_WIFI_STATE
                    ,Manifest.permission.CHANGE_WIFI_STATE
                    ,Manifest.permission.MOUNT_FORMAT_FILESYSTEMS
                    ,Manifest.permission.WRITE_EXTERNAL_STORAGE
                    ,Manifest.permission.READ_EXTERNAL_STORAGE
                    ,Manifest.permission.READ_LOGS
                    ,Manifest.permission.WAKE_LOCK
                    ,Manifest.permission.RECEIVE_BOOT_COMPLETED
                    ,Manifest.permission.WRITE_SETTINGS
                    ,Manifest.permission.WRITE_SECURE_SETTINGS
                    ,Manifest.permission.SET_TIME
                    ,Manifest.permission.SYSTEM_ALERT_WINDOW
                    ,Manifest.permission.CAMERA
                    ,Manifest.permission.RECORD_AUDIO
                    ,Manifest.permission.ACCESS_NETWORK_STATE
                    ,Manifest.permission.INSTALL_PACKAGES
                    ,Manifest.permission.REORDER_TASKS
                    ,Manifest.permission.READ_PHONE_STATE
                    ,Manifest.permission.ACCESS_COARSE_LOCATION}, 1);
        }
    }
}
